package com.dd.duu.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dd.dc.entity.users.DCommonCode;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * 描述: 数据字典 Feign
 *
 * @author: yanglin
 * @Date: 2021-03-17-8:57
 * @Version: 1.0
 */
@FeignClient(value = "dd-user-service")
public interface CodeClient {

    @PostMapping("/user/d-common-code/queryCodeList")
    Page<DCommonCode> queryCodeList(@RequestParam Integer page, @RequestParam Integer limit, @RequestParam String type, @RequestParam String codeName);

    @PostMapping("/user/d-common-code/insert")
    Integer insert(@RequestBody DCommonCode commonCode);

    @PostMapping("/user/d-common-code/updateById")
    boolean updateById(@RequestBody DCommonCode commonCode);

    @PostMapping("/user/d-common-code/saveBathChildCode")
    boolean saveBathChildCode(@RequestBody List<DCommonCode> children);

    @PostMapping("/user/d-common-code/deleteChild")
    boolean deleteChild(@RequestParam Integer cId);

    @PostMapping("/user/d-common-code/delete")
    boolean delete(@RequestParam Integer cId);
}
